local ffi = require "ffi"

ffi.cdef [[
    typedef struct {
        float top_right,
              bottom_right,
              top_left,
              bottom_left;
    } border_radius_t;
]]

local border_radius

---@class border_radius_mt
local mt = {

    ---@param tr number
    ---@param br number
    ---@param tl number
    ---@param bl number
    ---@return border_radius
    tr_br_tl_bl = function(tr, br, tl, bl) return border_radius(tr, br, tl, bl) end,

    ---@param all number,
    ---@return border_radius
    all = function(all) return border_radius(all, all, all, all) end,

    ---@param top number
    ---@return border_radius
    top = function(top) return border_radius(top, 0, top, 0) end,

    ---@param right number
    ---@return border_radius
    right = function(right) return border_radius(right, right, 0, 0) end,

    ---@param bottom number
    ---@return border_radius
    bottom = function(bottom) return border_radius(0, bottom, 0, bottom) end,

    ---@param left number
    ---@return border_radius
    left = function(left) return border_radius(0, 0, left, left) end,
}
mt.__index = mt

---@class border_radius : border_radius_mt
---@field top_right number
---@field bottom_right number
---@field top_left number
---@field bottom_left number
border_radius = ffi.metatype("border_radius_t", mt)

return border_radius
